package simple.form.db;

import javax.sql.DataSource;
import java.sql.Connection;

/**
 * Created by Administrator on 2017/2/27.
 */
public abstract class AbsDataSource{
    public final static  String URL = "url";
    public final static  String USER_NAME = "user_name";
    public final static  String PASS_WORD = "pass_word";
    public final static  String DRIVER = "driver";

    protected String url;
    protected String userName;
    protected String password;
    protected String driver;


    public String getDriver() {
        return driver;
    }

    public void setDriver(String driver) {
        this.driver = driver;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public abstract DataSource getDataSource();

    public abstract Connection getConnection();

    public abstract boolean closeDataSource();


}
